package iconSwingStates.Transitions;

import iconSwingStates.Event.EVirtualConPositionEvent;
/**
 * TDrag represents an interaction of Drag. This transitions isn't representated into the ICon device if it hasn't additional slots.
 * @author uribe-gaget
 *
 */
public class TDrag extends TPosition{

	/**
	 * Default contructor for the basic Drag action
	 * @param name The name of the transition
	 * @param pointer Pointer used to get the position
	 */
	public TDrag(String name, String pointer) {
		super(name, pointer);
	}
	/**
	 * Default contructor for the basic Drag action
	 * @param name The name of the transition
	 * @param pointer Pointer used to get the position
	 * @param output The output state
	 */
	public TDrag(String name, String pointer, String output) {
		super(name, pointer, false, output);
	}
	
	/**
	 * Default contructor for the basic Drag action, with multiple slots
	 * @param name The name of the transition
	 * @param pointer The pointer used to get the position
	 * @param type  type for the slot we want to add
	 * @param obligatory If all the slots must be connected or not
	 * @param synchro If all the slots, beside the position, must be active to fire the transition or not
	 */
	public TDrag(String name, String pointer, int type, boolean obligatory) {
		super(name, pointer, type, obligatory);
	}
	/**
	 * Default contructor for the basic Drag action, with multiple slots
	 * @param name The name of the transition
	 * @param pointer The pointer used to get the position
	 * @param type  type for the slot we want to add
	 * @param obligatory If all the slots must be connected or not
	 * @param synchro If all the slots, beside the position, must be active to fire the transition or not
	 * @param output The output state
	 */
	public TDrag(String name, String pointer,int type, boolean obligatory, String output) {
		super(name, pointer, type,obligatory, output);
	}
	
	
	/**
	 * Default contructor for the basic Drag action, with multiple slots
	 * @param name The name of the transition
	 * @param pointer The pointer used to get the position
	 * @param type Array of types for each slot we want to add
	 * @param obligatory If all the slots must be connected or not
	 * @param synchro If all the slots, beside the position, must be active to fire the transition or not
	 */
	public TDrag(String name, String pointer, int[] type, boolean obligatory,boolean synchro) {
		super(name, pointer, type, obligatory, synchro);
	}
	/**
	 * Default contructor for the basic Drag action, with multiple slots
	 * @param name The name of the transition
	 * @param pointer The pointer used to get the position
	 * @param type Array of types for each slot we want to add
	 * @param obligatory If all the slots must be connected or not
	 * @param synchro If all the slots, beside the position, must be active to fire the transition or not
	 * @param output The output state
	 */
	public TDrag(String name, String pointer,int[] type, boolean obligatory, boolean synchro,String output) {
		super(name, pointer, type,obligatory,synchro, output);
	}

	@Override
	public boolean matches(EVirtualConPositionEvent eventObject) {
		if(classEvent != null) {
			return classEvent.isAssignableFrom(EVirtualConPositionEvent.class);
		} else {
			if (eventObject instanceof EVirtualConPositionEvent) {
				String event = ((EVirtualConPositionEvent) eventObject).getNameEvent();
				return (event == null && getName() == null);
			}
		}
		return false;
	}

	@Override
	public EVirtualConPositionEvent getEvent() {
		return (EVirtualConPositionEvent)super.getEvent();
	}
	
	
}
